<script lang="ts">
import { h } from 'vue'
import { createFromIconfontCN } from '@ant-design/icons-vue'
import * as Icons from '@ant-design/icons-vue'

const IconFont = createFromIconfontCN()

export default {
  setup(props, ctx) {
    if (Icons[props.type]) {
      return () => h(Icons[props.type], null)
    } else {
      return () => h(IconFont, { type: props.type })
    }
  },
  props: {
    type: String
  }
}
</script>
